/* Main receiver function starts listening for results.
   When it accepts a result it divides current number
   in seperate process. */

int receiver(int segment_id, int sem_id, int receiver_port, struct info_table *shm,
	FILE *out_file, FILE *primes_file, int &sender_pid, int &logger_pid);

/* Check if number is prime.
   Uses OpenSSL library. */

int 
isPrime(ULL x);

/* Write result to file. */

void
write_result(FILE *out, ULL n, ULL p, UINT times_count);
